package com.cwj.mansysback.service.impl;

import com.cwj.mansysback.dao.impl.AccountDaoImpl;
import com.cwj.mansysback.entity.Account;
import com.cwj.mansysback.service.api.AccountService;

import java.util.Map;

public class AccountServiceImpl implements AccountService {

    private static final AccountDaoImpl accDao = new AccountDaoImpl();


    @Override
    public Account getAccount(Account acc) {
        return accDao.getAccount(acc);
    }

    public Account getAccount(String name, Integer rank) {
//        最后都全部写出来，避免其以后添加列时，旧代码报错
        return accDao.getAccount(name, rank);
    }

    @Override
    public boolean isTrue(Account acc) {
        return accDao.isTrue(acc);
    }

    @Override
    public boolean isExist(Account acc) {
        return accDao.isExists(acc);
    }

    @Override
    public boolean destroy(Account acc) {
        return accDao.deleteAccount(acc);
    }

    @Override
    public boolean setPassword(String name, Integer rank, String password) {
        return accDao.setPassword(name, rank, password);
    }
}
